#========================================================================
# ELLIKIT Elliptic solver kit
#========================================================================
# (c) Copyright Alberto Scotti, 2007
# Department of Marine Sciences
# University of North Carolina
# ascotti@unc.edu
# -----------------------------------------------------------------------
# This code may be freely used for educational and research purposes.
# For any other use please contact the author.
# -----------------------------------------------------------------------
# File:             Makefile
# Purpose:          Build libellikit.a and related examples
# Contains:
# Requires: 	    libskit.a (from SPARSEKIT2), libmkl_solver,libmkl_lapack,
#		    libmkl_ia32,libguide,libpthread (from MKL libraries)
#                   
# Revision History: Ver. 1.0 July 2007. A. Scotti
# -----------------------------------------------------------------------

default: libellikit.a
ELLIKITDIR=$(PWD)

all:
	(cd $(ELLIKITDIR)/src;make clean;make;\
	cd $(ELLIKITDIR)/examples/2D;make clean;make;\
	cd $(ELLIKITDIR)/examples/3D;make clean;make;\
	cd $(ELLIKITDIR)/examples/timing;make clean;make;cd $(ELLIKITDIR))
	(cd $(ELLIKITDIR)/doc;make ;cd  $(ELLIKITDIR))
distrib:
	(cd $(ELLIKITDIR)/src;make clean;\
        cd $(ELLIKITDIR)/examples/2D;make clean;\
	cd $(ELLIKITDIR)/examples/3D;make clean;\
        cd $(ELLIKITDIR)/examples/timing;make clean;\
	cd $(ELLIKITDIR)/doc;make clean;\
	cd $(ELLIKITDIR)/..;\
	tar zcvf ellikit.tgz ELLIKIT_WORKINPROGRESS/*)

libellikit.a:
	(cd $(ELLIKITDIR)/src;make clean;make;cd $(ELLIKITDIR))

clean:
	(cd $(ELLIKITDIR)/src;make clean)
	(cd $(ELLIKITDIR)/examples/2D;make clean)
	(cd $(ELLIKITDIR)/examples/3D;make clean)
	(cd $(ELLIKITDIR)/doc;make clean;cd  $(ELLIKITDIR))
	(cd $(ELLIKITDIR)/examples/timing;make clean;cd $(ELLIKITDIR);rm -f *~)
